home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 16 / PC Actual CD 16.iso / cdactual / vb / AdvLabel2 / IncLabel.ctl (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-09-15  |  3.1 KB  |  99 lines

  1. VERSION 5.00
  2. Begin VB.UserControl IncLabel 
  3.    ClientHeight    =   1500
  4.    ClientLeft      =   0
  5.    ClientTop       =   0
  6.    ClientWidth     =   4410
  7.    ScaleHeight     =   1500
  8.    ScaleWidth      =   4410
  9.    ToolboxBitmap   =   "IncLabel.ctx":0000
  10.    Begin VB.Timer tmrActualiza 
  11.       Interval        =   100
  12.       Left            =   120
  13.       Top             =   120
  14.    End
  15.    Begin VB.Label lblTexto 
  16.       Height          =   735
  17.       Left            =   0
  18.       TabIndex        =   0
  19.       Top             =   0
  20.       Width           =   4215
  21.    End
  22. Attribute VB_Name = "IncLabel"
  23. Attribute VB_GlobalNameSpace = False
  24. Attribute VB_Creatable = True
  25. Attribute VB_PredeclaredId = False
  26. Attribute VB_Exposed = True
  27. '*****************************************************
  28. ' Curso de creaci
  29. n de controles en VB5 para PCActual
  30. ' Fichero:  IncLabel (IncLabel.ctl)
  31. ' Autor:    Lleonard del R
  32. o (intec)
  33. ' Fecha:    1/9/97
  34. ' Versi
  35. n:  2.0
  36. ' Descr:    Control "etiqueta incremental", en el que
  37. '           van apareciendo poco a poco los caracteres
  38. '           que forman el texto.
  39. '*****************************************************
  40. Option Explicit
  41. '*****************************************************
  42. ' Material privado
  43. '*****************************************************
  44. Private Const M_CAPTION As String = ""
  45. Private m_sCaption As String
  46. Private m_lIndice As Long
  47. '*****************************************************
  48. ' Funciones privadas de soporte
  49. '*****************************************************
  50. Private Sub ActualizarCaption()
  51.     If Not Ambient.UserMode Then
  52.         lblTexto.Caption = m_sCaption
  53.         tmrActualiza.Enabled = False
  54.     Else
  55.         tmrActualiza.Enabled = False
  56.         m_lIndice = 0
  57.         tmrActualiza.Enabled = True
  58.     End If
  59. End Sub
  60. Private Sub tmrActualiza_Timer()
  61.     If m_lIndice = 0 Then lblTexto.Caption = M_CAPTION
  62.     m_lIndice = m_lIndice + 1
  63.     lblTexto.Caption = lblTexto.Caption & Mid$(m_sCaption, m_lIndice, 1)
  64.     If m_lIndice > Len(m_sCaption) Then
  65.         tmrActualiza.Enabled = False
  66.     End If
  67. End Sub
  68. Private Sub UserControl_Resize()
  69.     lblTexto.Width = UserControl.ScaleWidth
  70.     lblTexto.Height = UserControl.ScaleHeight
  71. End Sub
  72. '*****************************************************
  73. ' Persistencia de propiedades
  74. '*****************************************************
  75. Private Sub UserControl_InitProperties()
  76.     m_sCaption = M_CAPTION
  77.     ActualizarCaption
  78. End Sub
  79. Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  80.     m_sCaption = PropBag.ReadProperty("Caption", M_CAPTION)
  81.     ActualizarCaption
  82. End Sub
  83. Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  84.     Call PropBag.WriteProperty("Caption", m_sCaption, M_CAPTION)
  85. End Sub
  86. '*****************************************************
  87. ' Propiedades y m
  88. todos p
  89. blicos
  90. '*****************************************************
  91. Public Property Get Caption() As String
  92.     Caption = m_sCaption
  93. End Property
  94. Public Property Let Caption(ByVal Value As String)
  95.     m_sCaption = Value
  96.     PropertyChanged "Caption"
  97.     ActualizarCaption
  98. End Property
  99.